TimerManager = {}
TimerManager.mt = { __index = TimerManager }
setmetatable(TimerManager, TimerManager.mt)

function TimerManager:initialize()

	
	self.timers = {}
	
	self.uts_t = MOAITimer.new()
	self.uts = 0.00
	self.day = 0	
	self.base_time_mod = 2
	self.base_game_speed = GAME_SPEED
	self.time_mod = self.base_time_mod*self.base_game_speed
	
	
	

end


function TimerManager:new()

	self:initialize()

	return self

end

function TimerManager:pause_all()


	for i = 1, #self.timers do
	
		self.timers[i]:pause()
	
	end
	
	self.uts_t:pause()

end

function TimerManager:start_all()

	for i = 1, #self.timers do
	
		self.timers[i]:start()
	
	end
	
	self.uts_t:start()

end

function TimerManager:update()

	if GAME_SPEED ~= self.base_game_speed then
	
		self.base_game_speed = GAME_SPEED
		self.base_time_mod = self.time_mod
		self.time_mod = self.base_game_speed * self.base_time_mod
	
	
	end

end


function TimerManager:uts_minute()

	--if not self.time_mod then self.time_mod = 1 end
	
	if not self.uts then
	
		self.uts = 0.1
	
	else
	
		self.uts = self.uts + 0.1*self.time_mod
	
	end
	
	if self.uts >= 24 then 
		self.uts = self.uts - 24
		self.day = self.day + 1
	end

end


return TimerManager